<script setup>
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { useAppTxtStore } from './store/appTxt'

const appTxtStore = useAppTxtStore()

onLaunch(async (option) => {
  console.log('App Launch')
  console.log('option', option)

  // option.query.openid = 'op1i-5jxeH0Z6AztkYuLkC4xuIhg'

  // #ifdef H5
  if (option.query.openid) {
    uni.setStorageSync('token', option.query.openid)
    //
    let status = option.query.status

    if (status == '0') {
      // 审核中
    } else if (status == '1') {
      // 正常
    } else {
      // 封禁
    }
  }
  // #endif

  // #ifdef MP-WEIXIN
  appTxtStore.getAppTxt()
  // #endif


})
onShow(() => {
  console.log('App Show')
})
onHide(() => {
  console.log('App Hide')
})
</script>

<style lang="scss">
@import './static/scss/main.scss';

rich-text .custom-img {
  max-width: 100% !important;
}

button::after {
  border: none;
}

swiper,
scroll-view {
  flex: 1;
  height: 100%;
  overflow: hidden;
}

image {
  width: 100%;
  height: 100%;
  vertical-align: middle;
}

// 单行省略，优先使用 unocss: text-ellipsis
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 两行省略
.ellipsis-2 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

// 三行省略
.ellipsis-3 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
</style>
